<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 盒子的居中对齐：
        1.必须是块级元素,有宽度
        2. margin 左右变成auto就可以
         */
        div{
            width: 200px;
            height: 200px;
            background-color: pink;
            margin: 12px auto;
        }
        header{
            width: 500px;
            height: 100px;
            background-color: black;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <div>

    </div>

    <header></header>
</body>
</html>